<%@page import="com.gym.model.entity.Customer"%>
<%@page import="com.gym.model.entity.Course"%>
<%@page import="com.gym.model.entity.User"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>paymentManagement</title>
</head>
<jsp:include page="/jsp/menu.jsp" />
<% 
List<User> comboJustCustomers =(List<User>) session.getAttribute("comboJustCustomers");
List<Course> comboCourse =(List<Course>) session.getAttribute("comboCourse");

Customer customerFinded = (Customer) session.getAttribute("customerFinded");
Course courseFinded = (Course) session.getAttribute("courseFinded");
%>
<body>
<p style="color: red; 	text-shadow: 2px 2px 1px black; padding-left: 20%">
<%if(request.getAttribute("feedbackPaymentCompleted") != null){%>
	<%=request.getAttribute("feedbackPaymentCompleted")%>
<%}%>
</p>
<form action="findPayment.do" >
	<input type="submit" value="Scheda Payment">
</form>
<hr style="margin-top: 0%; margin-bottom: 0%;">

<form action="findCustomer.do" style="font-weight: bold; font-size: 20px; color: #003366; text-shadow: 2px 2px 1px grey;">
	Seleziona ID-USER:&nbsp;
	<select name="iduser">
		<%for(User u : comboJustCustomers){%>
			<option value="<%=u.getId()%>"><%= u.getEmail()%></option>
		<%}%>
	</select>
	<input type="submit" value="  OK  ">
</form>

<%if(customerFinded != null){%>
	<%@ include file="/jsp/customerDetail.jsp" %>
<%}%>
<hr style="margin-top: 0%; margin-bottom: 0%;">
<form action="findCourse.do" style="font-weight: bold;font-size: 20px; color: #003366;text-shadow: 2px 2px 1px grey;" >
	Seleziona ID-CORSO:&nbsp;
	<select name="idcourse">
		<%for(Course c: comboCourse){%>
			<option value="<%=c.getId()%>"><%= c.getActivity()+"| "+ c.getTrainer().getTrainerfirstname()+" "+c.getTrainer().getTrainerlastname() %></option>
		<%}%>
	</select>
	<input type="submit" value="  OK  ">
</form>
<%if(courseFinded != null){%>
	<%@ include file="/jsp/courseDetail.jsp" %>
<%}%>

<hr style="margin-top: 0%; margin-bottom: 0%;">

<%if(customerFinded != null && courseFinded != null){%>
	<form action="completePayment.do" >
	ABBONAMENTI<br>
	<input type="radio" name="months" value="1" checked />1<br>
	<input type="radio" name="months" value="3" />3<br>
	<input type="radio" name="months" value="6" />6<br>
	<input type="radio" name="months" value="12" />12<br>
	<br>
	
	<input type="hidden" name="iduser"   value="<%=customerFinded.getUser().getId()%>" >
	<input type="hidden" name="idcourse" value="<%=courseFinded.getId()%>" >
	
	<input type="submit" value="  Conferma  " class="submit">
	</form>
<%}%>



</body>
</html>